package com.wcy.feign.user;

import com.wcy.entity.User;
import com.wcy.util.vo.AuthRequest;
import com.wcy.util.vo.AuthResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "cloud-provider-user", contextId = "FeignAuthorizeController")
public interface FeignAuthorizeService {
    @PostMapping("auth/login")
    public ResponseEntity<AuthResponse> login(@RequestBody AuthRequest authRequest);

    @PostMapping("auth/register")
    public ResponseEntity<Void> register(@RequestBody User user);

    @PostMapping("auth/logout")
    public ResponseEntity<Boolean> logout(String token);

    @PostMapping("auth/validate")
    public ResponseEntity<Boolean> validate(String token);
}
